<template>
    <div>
        <van-nav-bar left-text="" left-arrow @click-left="router.go(-1)" />
        <div style="margin-top: 2rem;text-align: center;">
            <img src="../../img/p1.png" alt="">
        </div>



        <van-form @submit="onSubmit">
            <van-cell-group inset>
                <van-field v-model="username" name="username"  placeholder="请输入手机号"
                    :rules="[{ pattern : pattern , required: true, message: '请输入正确手机号' }]" />
            </van-cell-group>
            <div style="margin: 2rem;">已阅读并同意<span style="color: orange;"> 《小米商城用户协议》《小米商城意思政策》《小米账号用户协议》《小米账号隐私政策》</span></div>
            <div>
                <van-button round block type="primary" native-type="submit" style="width: 90%;margin-left: 5%;">
                    获取验证码
                </van-button>
            </div>
            <router-link to="/dl">
                <p style="margin-top: 3rem; text-align: center;">密码登录</p>
            </router-link>
            
        </van-form>

    </div>
</template>

<script setup>
import { useRoute, useRouter } from 'vue-router'
const router = useRouter()
import { ref } from 'vue'
let username = ref('')

let pattern  = /^1[3-9]\d{9}$/

const onSubmit = () =>{
    router.push('/reg')
}
</script>

<style lang="scss" scoped></style>